package org.example;

import java.util.*;

/**
 * @version: 1
 * @description: java
 * @author: java
 * @create: 2020-06-04 09:46
 **/
public class GenericDemo {
    public static void main(String[] args) {
        /*Map<String, Integer> map = new HashMap<>();
        map.put("k1", 1111);
        map.put("k2", 11122);
        map.put("k3", 132);
        map.put("k4", 111213);

        Set<Map.Entry<String, Integer>> entries = map.entrySet();
        Iterator<Map.Entry<String, Integer>> iterator = entries.iterator();
        while (iterator.hasNext()) {
            Map.Entry<String, Integer> next = iterator.next();
            System.out.println(next.getKey() + " : " + next.getValue());
        }*/
        /*for (Map.Entry<String, Integer> entry : map.entrySet()) {
            System.out.println(entry.getKey() + " : " + entry.getValue());
        }*/

        ArrayList arrayList = new ArrayList();
        arrayList.add("aaa");
        arrayList.add("aaac");
        test(arrayList);
    }

    private static void test(ArrayList<String> arrayList) {
        String str = "";
        for (String s : arrayList) {
            str += s;
        }
        System.out.println(str);
    }


}

class FU<T1,T2> {
}
class Zi1 extends FU {//子类不保留父类泛型 没有类型 擦除 等价于class Zi1 extends FU<Object,Object>
}
class Zi11<A,B> extends FU {}
//具体类型
class Zi2 extends FU<Integer, String> {
}
class Zi22<A,B> extends FU<Integer, String> {}
//子类保留父类泛型 全部保留
class Zi3<T1,T2> extends FU<T1,T2> {
}
class Zi33<T1,T2,A,B> extends FU<T1,T2>{}
//部分保留
class Zi4<T2> extends FU<Integer, T2> {
}
class Zi44<T2, A, B> extends FU<Integer, T2> {}



